#ifndef MAINGAME_H
#define MAINGAME_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsPixmapItem>
#include <QPixmap>
#include <QApplication>
#include "weizhi.h"
#include "battle.h"

namespace Ui {
class maingame;
}


class maingame : public QWidget
{
    Q_OBJECT

public:
    explicit maingame(QWidget *parent = nullptr);
    ~maingame();
    battle *battle1=NULL;//用来保存战斗界面的实例化对象地址
private slots:
    void on_fightButton_clicked();
protected:
    void keyPressEvent(QKeyEvent* event) override;
signals:
    void back();//定义一个用来返回的信号


private:
    Ui::maingame *ui;
    QGraphicsScene *scene;
    QGraphicsPixmapItem *mapItem;
    character *player;        // 新增角色对象
    void initScene();         // 初始化场景

};

#endif // MAINGAME_H
